<h1>文章列表</h1>
<%=render :partial =>"/admin/admin_articles/search" %>
<%= link_to '添加新文章', new_admin_admin_article_path %>
<table class="table">
  <tr>
    <th>分类</th>
    <th>标题</th>
    <th>副标题</th>
    <th>来源</th>
    <th>作者</th>
    <th>用户</th>
    <th>操作</th>
  </tr>
  
  <% @articles.each do |article| %>
    <tr>
      <td><%=h article.category.try(:name) %></td>
      <td><%=h article.title %></td>
      <td><%=h article.subhead %></td>
      <td><%=h article.from %></td>
      <td><%=h article.author %></td>
      <td><%=h article.user.try(:name) %></td>
      <td><%= link_to '显示', admin_admin_article_path(article) %>|
        <%= link_to '编辑', edit_admin_admin_article_path(article) %>|
        <%= link_to '删除', admin_admin_article_path(article), :confirm => 'Are you sure?', :method => :delete %></td>
    </tr>
  <% end %>
</table>

<br />

<%= link_to '添加新文章', new_admin_admin_article_path %>